<template>
    <div style="padding: 30px">
        <div>职位发布信息</div>

        <div style="margin-top: 20px">
            <el-menu :default-active="activeIndex"
                     class="el-menu-demo"
                     mode="horizontal"
                     @select="handleSelect">
                <el-menu-item index="1" @click="ispublish = 0">未发布</el-menu-item>
                <el-menu-item index="2" @click="ispublish = 1">已发布</el-menu-item>
            </el-menu>
        </div>


        <!--职位详情信息容器-->
        <div class="position_manager_info_contain">
            <!--数据内容-->
            <div>
                <el-table
                        ref="multipleTable"
                        :data="tableData"
                        tooltip-effect="dark"
                        style="width: 100%"
                        @selection-change="handleSelectionChange">
                    <el-table-column
                            type="selection"
                            width="55">
                    </el-table-column>

                    <el-table-column
                            label="职位名称"
                            width="180"
                            prop="jobName">
                    </el-table-column>

                    <el-table-column
                            prop="jobDeptement"
                            label="职位部门"
                            width="180">
                    </el-table-column>

                    <el-table-column
                            prop="isUrgency"
                            label="急聘"
                            width="150">
                        <template slot-scope="scope">
                            <el-tag
                                    :type="scope.row.isUrgency == 1?'danger':'success'"
                            >
                                  <span  v-if="scope.row.isUrgency == 1">
                                      急
                                  </span>

                                <span v-else>
                                    正常
                                </span>
                            </el-tag>
                        </template>
                    </el-table-column>

                    <el-table-column
                            prop="jobRecruitStatus"
                            label="招聘状态"
                            width="150">
                        <template slot-scope="scope">
                            <el-tag type="success" v-if="scope.row.jobRecruitStatus == '10310'">
                                <span>正在招聘</span>
                            </el-tag>

                            <el-tag type="warning" v-else-if="scope.row.jobRecruitStatus == '10320'">
                                <span>暂停招聘</span>
                            </el-tag>

                            <el-tag type="danger" v-else-if="scope.row.jobRecruitStatus == '10330'">
                                <span>停止招聘</span>
                            </el-tag>
                        </template>

                    </el-table-column>

                    <el-table-column
                            prop="createTime"
                            label="创建时间"
                            width="180">
                    </el-table-column>

                    <el-table-column
                            fixed="right"
                            label="操作"
                            width="310"
                    >
                        <template slot-scope="scope">


                            <el-button
                                    type="text"
                                    size="small"
                                    @click = "openDetailDialog(scope.row)"
                            >
                                职位详情
                            </el-button>


                            <el-button
                                    v-if="scope.row.jobIssueStatus == '10220'"
                                    disabled
                                    type="text"
                                    size="small"
                                    @click="cancelPublish(scope.row)"
                            >
                                撤销发布
                            </el-button>

                            <el-button
                                v-else
                                type="text"
                                size="small"
                                @click="cancelPublish(scope.row)"
                            >
                                撤销发布
                            </el-button>

                            <el-button
                                v-if="scope.row.jobIssueStatus == '10230'"
                                disabled
                                type="text"
                                size="small">
                                修改
                            </el-button>

                            <el-button
                                v-else
                                type="text"
                                size="small"
                                @click="openUpdateDialogVisit(scope.row)"
                            >
                                修改
                            </el-button>

                            <el-button
                                v-if="scope.row.jobIssueStatus == '10230'"
                                disabled
                                type="text"
                                size="small"
                                @click="publish(scope.row)">
                                发布职位
                            </el-button>
                            <el-button
                                v-else
                                type="text"
                                size="small"
                                @click="publish(scope.row)">
                                发布职位
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>



            <!--职位详情Dialog-->
            <el-dialog
                    title="职位详情"
                    :close-on-click-modal="false"
                    :visible.sync="detailDialogVisit">
                <el-form :model="dataForm"
                         label-width="130px"
                         :inline="true"
                >
                    <el-form-item label="职位名称" prop="jobName">
                        <el-col :span="24">
                            <el-input disabled v-model="dataForm.jobName" placeholder="职位名称"></el-input>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="职位部门" prop="jobDeptement">
                        <el-input  disabled v-model="dataForm.jobDeptement" placeholder="职位部门"></el-input>
                    </el-form-item>
                    <el-form-item label="联系人" prop="jobContact">
                        <el-input disabled v-model="dataForm.jobContact" placeholder="联系人"></el-input>
                    </el-form-item>
                    <el-form-item label="联系手机" prop="jobPhone">
                        <el-input disabled v-model="dataForm.jobPhone" placeholder="联系手机"></el-input>
                    </el-form-item>
                    <el-form-item label="联系固话" prop="jobFixPhone">
                        <el-input disabled v-model="dataForm.jobFixPhone" placeholder="联系固话"></el-input>
                    </el-form-item>
                    <el-form-item label="联系微信" prop="jobWechat">
                        <el-input disabled v-model="dataForm.jobWechat" placeholder="联系微信"></el-input>
                    </el-form-item>
                    <el-form-item label="联系邮箱" prop="jobEmail">
                        <el-input disabled v-model="dataForm.jobEmail" placeholder="联系邮箱"></el-input>
                    </el-form-item>
                    <el-form-item label="联系qq" prop="jobQq">
                        <el-input disabled v-model="dataForm.jobQq" placeholder="联系qq"></el-input>
                    </el-form-item>


                    <el-form-item label="紧急招聘" prop="isUrgency">
                        <el-col :span="22">
                            <el-select disabled v-model.number="dataForm.isUrgency" placeholder="是否急聘">
                                <el-option label="急聘" value="1"></el-option>
                                <el-option label="非急聘" value="0"></el-option>
                            </el-select>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="所属行业" prop="industryOptions" label-width="115px">
                        <el-col :span="22">
                            <el-cascader
                                    disabled
                                    v-model="industryOptionsArr"
                                    :options="industryOptions"
                            >
                            </el-cascader>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="工作地址" property="companyAddressOptions">
                        <el-col :span="22">
                            <el-cascader
                                    disabled
                                    v-model="companyAddressOptionsArr"
                                    :options="companyAddressOptions"
                            >
                            </el-cascader>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="详细地址" prop="jobDetailAddress" label-width="115px">
                        <el-col :span="24">
                            <el-input disabled v-model="dataForm.jobDetailAddress" placeholder="详细地址"></el-input>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="薪资范围" required>
                        <el-col :span="11">
                            <el-form-item prop="jobSalaryStart">
                                <el-input disabled v-model="dataForm.jobSalaryStart" style="width: 100%;" placeholder="薪资范围"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="1">-</el-col>
                        <el-col :span="11">
                            <el-form-item prop="jobSalaryEnd">
                                <el-input disabled v-model="dataForm.jobSalaryEnd" style="width: 100%;" placeholder="薪资范围"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="年龄要求" required>
                        <el-col :span="11">
                            <el-form-item prop="jobAgeStart">
                                <el-input disabled v-model="dataForm.jobAgeStart" style="width: 100%;" placeholder="年龄要求"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="1">-</el-col>
                        <el-col :span="11">
                            <el-form-item prop="jobAgeEnd">
                                <el-input disabled v-model="dataForm.jobAgeEnd" style="width: 100%;" placeholder="年龄要求"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form-item>


                    <el-form-item label="证书要求" prop="detailPosition" >
                        <el-select
                                disabled
                                v-model="positionCertifiCate"
                                clearable
                                multiple
                                placeholder="请选择">
                            <el-option
                                    v-for="item in certifiCateOption"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="职位福利" prop="detailPosition" label-width="100px">
                        <el-select
                                disabled
                                v-model="positionWalfare"
                                clearable
                                multiple
                                placeholder="请选择">
                            <el-option
                                    v-for="item in walfareOption"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>


                    <el-form-item label="职位描述" prop="jobDescript">
                        <el-input
                                disabled
                                style="width: 500px"
                                type="textarea"
                                v-model="dataForm.jobDescript"
                                placeholder="职位描述"
                                :rows = "5"
                                :cols="50"
                                maxlength="100"
                                show-word-limit>
                        </el-input>
                    </el-form-item>

                </el-form>
                <span slot="footer" class="dialog-footer">
      <el-button @click="closeDetailDialog()">取消</el-button>
    </span>
            </el-dialog>


            <!--职位修改的Dialog-->
            <el-dialog
                    :title="'修改'"
                    :close-on-click-modal="false"
                    :visible.sync="updateDetailDialogVisit">
                <el-form :model="dataForm"
                         :rules="dataRule"
                         ref="dataForm" @keyup.enter.native="dataFormUpdataSubmit()"
                         label-width="130px"
                         :inline="true"
                >
                    <el-form-item label="职位名称" prop="jobName">
                        <el-col :span="24">
                            <el-input v-model="dataForm.jobName" placeholder="职位名称"></el-input>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="职位部门" prop="jobDeptement">
                        <el-input v-model="dataForm.jobDeptement" placeholder="职位部门"></el-input>
                    </el-form-item>
                    <el-form-item label="联系人" prop="jobContact">
                        <el-input v-model="dataForm.jobContact" placeholder="联系人"></el-input>
                    </el-form-item>
                    <el-form-item label="联系手机" prop="jobPhone">
                        <el-input v-model="dataForm.jobPhone" placeholder="联系手机"></el-input>
                    </el-form-item>
                    <el-form-item label="联系固话" prop="jobFixPhone">
                        <el-input v-model="dataForm.jobFixPhone" placeholder="联系固话"></el-input>
                    </el-form-item>
                    <el-form-item label="联系微信" prop="jobWechat">
                        <el-input v-model="dataForm.jobWechat" placeholder="联系微信"></el-input>
                    </el-form-item>
                    <el-form-item label="联系邮箱" prop="jobEmail">
                        <el-input v-model="dataForm.jobEmail" placeholder="联系邮箱"></el-input>
                    </el-form-item>
                    <el-form-item label="联系qq" prop="jobQq">
                        <el-input v-model="dataForm.jobQq" placeholder="联系qq"></el-input>
                    </el-form-item>


                    <el-form-item label="紧急招聘" prop="isUrgency">
                        <el-col :span="22">
                            <el-select v-model="dataForm.isUrgency" placeholder="是否急聘">
                                <el-option label="急聘" value="1"></el-option>
                                <el-option label="非急聘" value="0"></el-option>
                            </el-select>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="所属行业" prop="industryOptions" label-width="115px">
                        <el-col :span="22">
                            <el-cascader
                                    v-model="industryOptionsArr"
                                    :options="industryOptions"
                                    @change="handleChangeIndustory">
                            </el-cascader>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="工作地址" property="companyAddressOptions">
                        <el-col :span="22">
                            <el-cascader
                                    v-model="companyAddressOptionsArr"
                                    :options="companyAddressOptions"
                                    @change="handleChangeAddress">
                            </el-cascader>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="详细地址" prop="jobDetailAddress" label-width="115px">
                        <el-col :span="24">
                            <el-input v-model="dataForm.jobDetailAddress" placeholder="详细地址"></el-input>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="薪资范围" required>
                        <el-col :span="11">
                            <el-form-item prop="jobSalaryStart">
                                <el-input v-model="dataForm.jobSalaryStart" style="width: 100%;" placeholder="薪资范围"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="1">-</el-col>
                        <el-col :span="11">
                            <el-form-item prop="jobSalaryEnd">
                                <el-input v-model="dataForm.jobSalaryEnd" style="width: 100%;" placeholder="薪资范围"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form-item>

                    <el-form-item label="年龄要求" required>
                        <el-col :span="11">
                            <el-form-item prop="jobAgeStart">
                                <el-input v-model="dataForm.jobAgeStart" style="width: 100%;" placeholder="年龄要求"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="1">-</el-col>
                        <el-col :span="11">
                            <el-form-item prop="jobAgeEnd">
                                <el-input v-model="dataForm.jobAgeEnd" style="width: 100%;" placeholder="年龄要求"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form-item>


                    <el-form-item label="证书要求" prop="detailPosition" >
                        <el-select
                                v-model="positionCertifiCate"
                                clearable
                                multiple
                                @change="positionCertifiCateOptionChange"
                                placeholder="请选择">
                            <el-option
                                    v-for="item in certifiCateOption"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>

                    <el-form-item label="职位福利" prop="detailPosition" label-width="100px">
                        <el-select
                                v-model="positionWalfare"
                                clearable
                                multiple
                                @change="positionOptionChange"
                                placeholder="请选择">
                            <el-option
                                    v-for="item in walfareOption"
                                    :key="item.value"
                                    :label="item.label"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>


                    <el-form-item label="职位描述" prop="jobDescript">
                        <el-input
                                style="width: 500px"
                                type="textarea"
                                v-model="dataForm.jobDescript"
                                placeholder="职位描述"
                                :rows = "5"
                                :cols="50"
                                maxlength="100"
                                show-word-limit>
                        </el-input>
                    </el-form-item>

                </el-form>
                <span slot="footer" class="dialog-footer">
                  <el-button @click="updateDetailDialogVisit = false">取消</el-button>
                  <el-button type="primary" @click="dataFormUpdataSubmit()">确定</el-button>
                </span>
            </el-dialog>





            <!--分页条-->
            <div style="text-align: center;margin-top: 15px">
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="pageSizes"
                            :page-size="pageSize"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="total">
                    </el-pagination>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import workjobApi from "@/api/workjobs/workjobApi";
    import commonApi from "@/api/commonApi";

    export default {
        inject:['reload'],
        name: "my-publish-company-info-two",
        data(){
            return{
                dataForm:{
                    jobName: '',
                    jobDescript: '',
                    jobDeptement: '',
                    jobContact: '',
                    jobPhone: '',
                    jobFixPhone: '',
                    jobWechat: '',
                    jobEmail: '',
                    jobQq: '',
                    isUrgency: '',                     //是否是急聘
                    companyId: '',
                    tradeId: '',
                    classifyId: '',
                    jobTypeId: '',
                    provincesId: '',
                    citysId: '',
                    areasId: '',
                    jobSalaryStart: '',
                    jobSalaryEnd: '',
                    jobApproveStatus: '',
                    jobIssueStatus: '',
                    jobRecruitStatus: '',
                    jobIsPass: '',
                    jobAgeStart: '',
                    jobAgeEnd: '',
                    jobDetailAddress: '',
                },

                dataRule: {
                    jobName: [
                        { required: true, message: '职位名称不能为空', trigger: 'blur' }
                    ],
                    jobDescript: [
                        { required: true, message: '职位描述不能为空', trigger: 'blur' }
                    ],
                    jobDeptement: [
                        { required: true, message: '职位部门不能为空', trigger: 'blur' }
                    ],
                    jobContact: [
                        { required: true, message: '联系人不能为空', trigger: 'blur' }
                    ],
                    jobPhone: [
                        { required: true, message: '联系手机不能为空', trigger: 'blur' }
                    ],
                    jobFixPhone: [
                        { required: true, message: '联系固话不能为空', trigger: 'blur' }
                    ],
                    jobWechat: [
                        { required: true, message: '联系微信不能为空', trigger: 'blur' }
                    ],
                    jobEmail: [
                        { required: true, message: '联系邮箱不能为空', trigger: 'blur' }
                    ],
                    jobQq: [
                        { required: true, message: '联系qq不能为空', trigger: 'blur' }
                    ],
                    isUrgency: [
                        { required: true, message: '是否紧急招聘不能为空', trigger: 'blur' }
                    ],
                    companyId: [
                        { required: true, message: '企业ID不能为空', trigger: 'blur' }
                    ],
                    jobSalaryStart: [
                        { required: true, message: '请输入起始薪资', trigger: 'blur' }
                    ],
                    jobSalaryEnd: [
                        { required: true, message: '请输入结束薪资', trigger: 'blur' }
                    ],
                    jobAgeStart: [
                        { required: true, message: '请输入起始年龄', trigger: 'blur' }
                    ],
                    jobAgeEnd: [
                        { required: true, message: '请输入结束年龄', trigger: 'blur' }
                    ],
                    jobDetailAddress: [
                        { required: true, message: '详细地址不能为空', trigger: 'blur' }
                    ]
                },


                detailDialogVisit:false,        //详情的弹出框
                updateDetailDialogVisit:false,  //修改职位信息的弹出框



                ispublish:0,                //控制发布职位信息的切换
                activeIndex:'1',

                tableData: [],
                multipleSelection: [],  //多选框

                currentPage:1,          //分页设置
                pageSizes:[1,2,3,4],    //每一页显示的条目数
                total:5,                //总条数
                pageSize:3,             //总页数量
                publishStatus:'10220',   //10220未发布 10230 已发布


                userId:'',                        //当前的userId
                certifiCateOption:[],             //证书列表
                walfareOption:[],                 //福利列表


                positionCertifiCate:[],
                positionWalfare:[],

                industryOptions:[],               //行业的选项卡
                industryOptionsArr:[],            //选中的值
                //1000 1001 100101
                companyAddressOptions:[],         //地址的选项卡
                companyAddressOptionsArr:[],      //选中的值

            }
        },
        created() {
        },
        mounted() {
            this.isPublish()
            this.iPageListPositionPublish()

            this.loadingCertificates()
            this.loadingWalfare()
            this.loadingAddress()
            this.loadingIndustory()

        },
        methods:{
            /*加载证书*/
            loadingCertificates(){
              commonApi.loadingCertifiCate()
              .then(data =>{
                  if (data.data.code === 0){
                      this.certifiCateOption = data.data.data
                  }
              }).catch(err =>{
                  Promise.reject(err)
              })

            },
            /*加载福利*/
            loadingWalfare(){
                commonApi.loadingWelfare()
                .then(data => {
                    if (data.data.code === 0){
                        this.walfareOption = data.data.data
                    }
                })
                .catch(err => {
                    Promise.reject(err)
                })
            },
            /*加载地址*/
            loadingAddress(){
              commonApi.loadingCompanyAddress()
              .then(data =>{
                  if (data.data.code === 0){
                      this.companyAddressOptions =data.data.data
                  }
              }).catch(error => {
                  Promise.reject(error)
              })
            },
            /*加载行业*/
            loadingIndustory(){
                commonApi.loadingIndustoryTwo()
                .then(data => {
                    this.industryOptions = data.data.data
                })
                .catch(err => {
                    Promise.reject(err)
                })
            },

            /*撤销发布的职位*/
            cancelPublish(object){

                console.log("log cancel ==>",object)
                workjobApi.cancelPublish(object.id)
                .then(data => {
                    if (data.data.code === 0){
                        this.$message({
                            type:'success',
                            message:'职位撤销成功'
                        })
                        this.reload()
                    }else if (data.data.code === 500){
                        this.$message({
                            type:'danger',
                            message:'职位撤销失败'
                        })
                        this.reload()
                    }
                })
                .catch(err => {
                    Promise.reject(err)
                })




            },



            publish(obj){
                console.log(obj)
                this.$confirm('确认发布 '+ obj.jobName +'该职位?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    const id = obj.id
                    workjobApi.publish(id)
                        .then(data => {
                            //console.log("publish data ==>>",data)
                            this.$message({
                                type:'success',
                                message:'职位发布成功'
                            })
                            this.reload()           //刷新页面
                        })
                        .catch(error => {
                            Promise.reject(error)
                        })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '取消发布'
                    });
                });



            },
            /*加载列表*/
            iPageListPositionPublish(){
                this.userId = JSON.parse(localStorage.getItem("user")).userId
                workjobApi.iPageListPositionPublish(this.currentPage,this.pageSize,this.userId,this.publishStatus)
                .then(data => {
                    // console.log("datass ====>>>",data)
                    this.tableData = data.data.page.list                //
                    this.currentPage = data.data.page.currPage          //当前页码
                    this.pageSize = data.data.page.pageSize             //当前每页的条数数量
                    this.total = data.data.page.totalCount              //总页数
                })
                .catch(error => {
                    Promise.reject(error)
                })
            },
            /*职位是否发布*/
            isPublish(){
                if (this.ispublish === 1){
                    this.publishStatus = '10230'
                    this.iPageListPositionPublish()
                }else{
                    this.publishStatus = '10220'
                    this.iPageListPositionPublish()
                }
            },


            /*提交修改的信息*/
            dataFormUpdataSubmit(){
                let object = {
                    'id': this.dataForm.id || undefined,
                    'jobName': this.dataForm.jobName,
                    'jobDescript': this.dataForm.jobDescript,
                    'jobDeptement': this.dataForm.jobDeptement,
                    'jobContact': this.dataForm.jobContact,
                    'jobPhone': this.dataForm.jobPhone,
                    'jobFixPhone': this.dataForm.jobFixPhone,
                    'jobWechat': this.dataForm.jobWechat,
                    'jobEmail': this.dataForm.jobEmail,
                    'jobQq': this.dataForm.jobQq,
                    'isUrgency': this.dataForm.isUrgency,
                    'companyId': this.dataForm.companyId,
                    'tradeId': this.dataForm.tradeId,
                    'classifyId': this.dataForm.classifyId,
                    'jobTypeId': this.dataForm.jobTypeId,
                    'provincesId': this.dataForm.provincesId,
                    'citysId': this.dataForm.citysId,
                    'areasId': this.dataForm.areasId,
                    'jobSalaryStart': this.dataForm.jobSalaryStart,
                    'jobSalaryEnd': this.dataForm.jobSalaryEnd,
                    'jobApproveStatus': this.dataForm.jobApproveStatus,
                    'jobIssueStatus': this.dataForm.jobIssueStatus,
                    'jobRecruitStatus': this.dataForm.jobRecruitStatus,
                    'jobIsPass': this.dataForm.jobIsPass,
                    'jobAgeStart': this.dataForm.jobAgeStart,
                    'jobAgeEnd': this.dataForm.jobAgeEnd,
                    'jobDetailAddress': this.dataForm.jobDetailAddress,
                    'positionCertifiCate':this.positionCertifiCate,
                    'positionWalfare':this.positionWalfare,
                    'createUserId':this.userId
                }

                workjobApi.updataWorkInfo(object)
                .then(data => {
                    if (data.data.code === 0){
                        this.$message({
                            type:'success',
                            message:'职位信息修改成功'
                        })
                        this.updateDetailDialogVisit = false
                    }
                })
                .catch(err => {
                    Promise.reject(err)
                })


            },
            handleSelect(){},
            //多选框信息
            handleSelectionChange(){

            },
            // 当每页的条数发生变化的时候触发
            handleSizeChange(value){
                this.pageSize = value;
                this.iPageListPositionPublish()
            },
            // 当前页发生变化的时候触发
            handleCurrentChange(value){
                this.currentPage = value
                this.iPageListPositionPublish()
            },
            //打开修改的Dialog
            openUpdateDialogVisit(object){
                console.log(object)
                object.isUrgency = object.isUrgency.toString()
                this.dataForm = object
                commonApi.loadingJobIdBelongAddress(object.id)
                    .then(data =>{
                        if (data.data.code === 0){
                            this.companyAddressOptionsArr = data.data.data
                            console.log("this.companyAddressOptionsArr ====> ",this.companyAddressOptionsArr)
                        }
                    })
                    .catch(err => {
                        Promise.reject(err)
                    })
                console.log("object.id ===>",object.id)
                commonApi.loadingJobIdBelongIndustory(object.id)
                    .then(data => {
                        if (data.data.code === 0){
                            this.industryOptionsArr = data.data.data
                        }
                    }).catch(err =>{
                    Promise.reject(err)
                })
                commonApi.loadingJobIdBelongCertificates(object.id)
                    .then(data =>{
                        if (data.data.code === 0){
                            this.positionCertifiCate = data.data.data
                        }
                    })
                    .catch(err =>{
                        Promise.reject(err)
                    })


                commonApi.loadingJobIdBelongWalfare(object.id)
                    .then(data =>{
                        if (data.data.code === 0){
                            this.positionWalfare = data.data.data
                        }
                    })
                    .catch(err => {
                        Promise.reject(err)
                    })
                this.updateDetailDialogVisit = true;
            },
            //打开详情Dialoog
            openDetailDialog(object){
                console.log(object)
                object.isUrgency = object.isUrgency.toString()
                this.dataForm = object
                commonApi.loadingJobIdBelongAddress(object.id)
                .then(data =>{
                    if (data.data.code === 0){
                        this.companyAddressOptionsArr = data.data.data
                        //console.log("this.companyAddressOptionsArr ====> ",this.companyAddressOptionsArr)
                    }
                })
                .catch(err => {
                    Promise.reject(err)
                })

                commonApi.loadingJobIdBelongIndustory(object.id)
                .then(data => {
                    if (data.data.code === 0){
                        this.industryOptionsArr = data.data.data

                        console.log("this.industryOptionsArr  ==>> ",this.industryOptionsArr )
                    }
                }).catch(err =>{
                    Promise.reject(err)
                })


                commonApi.loadingJobIdBelongCertificates(object.id)
                .then(data =>{
                    if (data.data.code === 0){
                        this.positionCertifiCate = data.data.data
                    }
                })
                .catch(err =>{
                    Promise.reject(err)
                })


                commonApi.loadingJobIdBelongWalfare(object.id)
                .then(data =>{
                    if (data.data.code === 0){
                        this.positionWalfare = data.data.data
                    }
                })
                .catch(err => {
                    Promise.reject(err)
                })

                this.detailDialogVisit = true;
            },
            //关闭详情Dialog
            closeDetailDialog(){
                this.detailDialogVisit = false
            },
            //职位福利change事件
            positionOptionChange(value){
                console.log("positionOpti ====>",value)
            },
            //职位证书要求 change事件
            positionCertifiCateOptionChange(value){
                console.log("position certifiCate ==>>",value)
            },
            //职位所属行业 change事件
            handleChangeIndustory(value){
                console.log("行业的value ===》",value)
                this.dataForm.tradeId = value[0]
                this.dataForm.classifyId = value[1]
                this.dataForm.jobTypeId = value[2]
                console.log("行业1 ==>" ,this.dataForm.tradeId)
                console.log("行业2 ==>" ,this.dataForm.classifyId)
                console.log("行业3 ==>" ,this.dataForm.jobTypeId)
            },
            //职位所属地址 change事件
            handleChangeAddress(value){
                console.log("地址的value ===》",value)
                this.dataForm.provincesId = value[0]
                this.dataForm.citysId = value[1]
                this.dataForm.areasId = value[2]
                console.log("地址1 ==》",this.dataForm.provincesId)
                console.log("地址2 ==》",this.dataForm.citysId)
                console.log("地址3 ==》",this.dataForm.areasId)
            }
        },
        computed:{
            getIsPublish(){
                return this.ispublish
            }
        },
        watch:{
            getIsPublish:{
                handler(){
                    this.isPublish()
                }
            }
        }
    }
</script>

<style>

</style>
